<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>股票价格预测 - Flask应用</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <style>
        .bg-stock {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
    </style>
</head>
<body class="bg-gray-50 min-h-screen">
    <header class="bg-stock text-white shadow-md">
        <div class="container mx-auto px-4 py-6">
            <h1 class="text-3xl font-bold text-center">股票价格预测系统</h1>
            <p class="text-center mt-2">基于LSTM神经网络的股票价格预测</p>
        </div>
    </header>

    <div class="container mx-auto px-4 py-8">
        <div class="max-w-2xl mx-auto">
            <div class="bg-white rounded-lg shadow-lg p-8 card-hover">
                {% if error %}
                <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-6" role="alert">
                    <strong class="font-bold">错误!</strong>
                    <span class="block sm:inline">{{ error }}</span>
                </div>
                {% endif %}

                <form method="POST" class="space-y-6">
                    <div>
                        <label for="code" class="block text-gray-700 text-sm font-bold mb-2">
                            请输入股票代码 (例如: 000001)
                        </label>
                        <div class="flex">
                            <input type="text" id="code" name="code"
                                class="flex-grow px-4 py-2 border rounded-l focus:outline-none focus:ring-2 focus:ring-stock"
                                placeholder="输入股票代码" required>
                            <button type="submit"
                                class="bg-stock hover:bg-stock/90 text-white font-bold py-2 px-4 rounded-r transition-colors duration-300">
                                预测
                            </button>
                        </div>
                    </div>

                    <div class="flex justify-center">
                        <div class="text-sm text-gray-500">
                            <p>支持A股股票代码 (例如: 000001 平安银行, 600000 浦发银行)</p>
                        </div>
                    </div>
                </form>
            </div>

            <div class="mt-8 text-center">
                <div class="bg-white rounded-lg shadow-md p-6">
                    <h3 class="text-xl font-semibold text-gray-800 mb-4">关于股票预测</h3>
                    <p class="text-gray-600 mb-2">
                        本系统使用LSTM神经网络模型对股票价格进行预测，仅供参考，不构成投资建议。
                    </p>
                    <p class="text-gray-600">
                        股票市场具有不确定性，预测结果可能与实际价格存在偏差。
                    </p>
                </div>
            </div>
        </div>
    </div>

    <footer class="bg-gray-800 text-white py-6 mt-12">
        <div class="container mx-auto px-4 text-center">
            <p>© 2023 股票价格预测系统 - 使用Flask和TensorFlow构建</p>
        </div>
    </footer>
</body>
</html>